import 'package:demo/event/event-bus.dart';
import 'package:demo/event/event-model.dart';
import 'package:demo/navigator/tab_navigator.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'routers/routes.dart';
import 'routers/application.dart';


void main() {
  runApp(MyApp());
}
class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {

  @override
  void initState() {
    super.initState();
    final router = new Router();
    Routes.configureRoutes(router);
    Application.router = router;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: BotToastInit(),
      navigatorObservers: [BotToastNavigatorObserver()],
      theme: ThemeData(
        primaryColor: const Color.fromRGBO(77, 145, 253, 1.0),
        accentColor: const Color(0xFFB2BAC2),
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('title'),
        ),
        bottomNavigationBar: TabNavigator(),
      ),
      onGenerateRoute: Application.router.generator,
    );
  }
}
